
f = open('test1.txt', 'w', encoding='UTF-8')
f.write("hello")
f.write('\n')
f.write("world\n")

# 刷新缓存
# f.flush()

# 默认刷新缓存
f.close()
